From: Zephaniah E. Loss-Cutler-Hull Date: Sat, 15 Aug 2020 10:23:27 +0000 (-0700) Subject: unlockDialog: Defend against absence of blur effect X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=093603b35e085ffa88c49bae6a35fd93ce856e4d;p=gnome-shell.git unlockDialog: Defend against absence of blur effect widget.get_effect(...) can return null while locking the screen, resulting in a TypeError. In this situation the screen ends up black with a cursor but never going to sleep, and moving the mouse brings the old screen contents up but does not allow unlocking. unlockDialog.js assumes that widget.get_effect will return non-null, but other places such as getWindowDimmer in windowManager.js go out of their way to be more careful. [smcv: Add commit message, remove hard tabs, add missing semicolon] Resolves: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3071 Bug-Debian: https://bugs.debian.org/968440 --- diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index aea7b6004..4f461f398 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -647,10 +647,14 @@ var UnlockDialog = GObject.registerClass({ const themeContext = St.ThemeContext.get_for_stage(global.stage); for (const widget of this._backgroundGroup) { - widget.get_effect('blur').set({ - brightness: BLUR_BRIGHTNESS, - sigma: BLUR_SIGMA * themeContext.scale_factor, - }); + const effect = widget.get_effect('blur'); + + if (effect) { + effect.set({ + brightness: BLUR_BRIGHTNESS, + sigma: BLUR_SIGMA * themeContext.scale_factor, + }); + } } }